using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace SmartIot.Models.SolarTerms
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [BindTable("Terms", Description = "", ConnName = "ConnName_SolarTerms", DbType = DatabaseType.MySql)]
    public partial class Terms : ITerms
    {
        #region 属性
        private Int32 _ID;
        /// <summary></summary>
        [DisplayName("ID")]
        [DataObjectField(true, true, false, 0)]
        [BindColumn("ID", "", "int(11)")]
        public Int32 ID { get { return _ID; } set { if (OnPropertyChanging(__.ID, value)) { _ID = value; OnPropertyChanged(__.ID); } } }

        private String _Name;
        /// <summary>名称</summary>
        [DisplayName("名称")]
        [Description("名称")]
        [DataObjectField(false, false, true, 255)]
        [BindColumn("Name", "名称", "varchar(255)", Master = true)]
        public String Name { get { return _Name; } set { if (OnPropertyChanging(__.Name, value)) { _Name = value; OnPropertyChanged(__.Name); } } }

        private String _En;
        /// <summary>英文</summary>
        [DisplayName("英文")]
        [Description("英文")]
        [DataObjectField(false, false, true, 255)]
        [BindColumn("En", "英文", "varchar(255)")]
        public String En { get { return _En; } set { if (OnPropertyChanging(__.En, value)) { _En = value; OnPropertyChanged(__.En); } } }

        private String _Season;
        /// <summary>季节</summary>
        [DisplayName("季节")]
        [Description("季节")]
        [DataObjectField(false, false, true, 255)]
        [BindColumn("Season", "季节", "varchar(255)")]
        public String Season { get { return _Season; } set { if (OnPropertyChanging(__.Season, value)) { _Season = value; OnPropertyChanged(__.Season); } } }

        private String _Intro;
        /// <summary>介绍</summary>
        [DisplayName("介绍")]
        [Description("介绍")]
        [DataObjectField(false, false, true, 255)]
        [BindColumn("Intro", "介绍", "varchar(255)")]
        public String Intro { get { return _Intro; } set { if (OnPropertyChanging(__.Intro, value)) { _Intro = value; OnPropertyChanged(__.Intro); } } }

        private String _TimeRange;
        /// <summary>时间范围</summary>
        [DisplayName("时间范围")]
        [Description("时间范围")]
        [DataObjectField(false, false, true, 255)]
        [BindColumn("TimeRange", "时间范围", "varchar(255)")]
        public String TimeRange { get { return _TimeRange; } set { if (OnPropertyChanging(__.TimeRange, value)) { _TimeRange = value; OnPropertyChanged(__.TimeRange); } } }

        private String _Remark;
        /// <summary>备注</summary>
        [DisplayName("备注")]
        [Description("备注")]
        [DataObjectField(false, false, true, 255)]
        [BindColumn("Remark", "备注", "varchar(255)")]
        public String Remark { get { return _Remark; } set { if (OnPropertyChanging(__.Remark, value)) { _Remark = value; OnPropertyChanged(__.Remark); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.ID : return _ID;
                    case __.Name : return _Name;
                    case __.En : return _En;
                    case __.Season : return _Season;
                    case __.Intro : return _Intro;
                    case __.TimeRange : return _TimeRange;
                    case __.Remark : return _Remark;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.ID : _ID = Convert.ToInt32(value); break;
                    case __.Name : _Name = Convert.ToString(value); break;
                    case __.En : _En = Convert.ToString(value); break;
                    case __.Season : _Season = Convert.ToString(value); break;
                    case __.Intro : _Intro = Convert.ToString(value); break;
                    case __.TimeRange : _TimeRange = Convert.ToString(value); break;
                    case __.Remark : _Remark = Convert.ToString(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得Terms字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary></summary>
            public static readonly Field ID = FindByName(__.ID);

            /// <summary>名称</summary>
            public static readonly Field Name = FindByName(__.Name);

            /// <summary>英文</summary>
            public static readonly Field En = FindByName(__.En);

            /// <summary>季节</summary>
            public static readonly Field Season = FindByName(__.Season);

            /// <summary>介绍</summary>
            public static readonly Field Intro = FindByName(__.Intro);

            /// <summary>时间范围</summary>
            public static readonly Field TimeRange = FindByName(__.TimeRange);

            /// <summary>备注</summary>
            public static readonly Field Remark = FindByName(__.Remark);

            static Field FindByName(String name) { return Meta.Table.FindByName(name); }
        }

        /// <summary>取得Terms字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary></summary>
            public const String ID = "ID";

            /// <summary>名称</summary>
            public const String Name = "Name";

            /// <summary>英文</summary>
            public const String En = "En";

            /// <summary>季节</summary>
            public const String Season = "Season";

            /// <summary>介绍</summary>
            public const String Intro = "Intro";

            /// <summary>时间范围</summary>
            public const String TimeRange = "TimeRange";

            /// <summary>备注</summary>
            public const String Remark = "Remark";
        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface ITerms
    {
        #region 属性
        /// <summary></summary>
        Int32 ID { get; set; }

        /// <summary>名称</summary>
        String Name { get; set; }

        /// <summary>英文</summary>
        String En { get; set; }

        /// <summary>季节</summary>
        String Season { get; set; }

        /// <summary>介绍</summary>
        String Intro { get; set; }

        /// <summary>时间范围</summary>
        String TimeRange { get; set; }

        /// <summary>备注</summary>
        String Remark { get; set; }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}